<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<!-- qtsoap.cpp -->
<head>
  <title>QtSoapArrayIterator Class Reference</title>
  <link href="classic.css" rel="stylesheet" type="text/css" />
</head>
<body>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td align="left" valign="top" width="32"><img src="images/qt-logo.png" align="left" width="57" height="67" border="0" /></td>
<td width="1">&nbsp;&nbsp;</td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a></td>
</tr></table><h1 class="title">QtSoapArrayIterator Class Reference</h1>
<p>The QtSoapArrayIterator class provides an iterator for traversing the items in a <a href="qtsoaparray.html">QtSoapArray</a>. <a href="#details">More...</a></p>
<pre> #include &lt;QtSoapArrayIterator&gt;</pre><ul>
<li><a href="qtsoaparrayiterator-members.html">List of all members, including inherited members</a></li>
</ul>
<hr />
<a name="public-functions"></a>
<h2>Public Functions</h2>
<table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr><td class="memItemLeft" align="right" valign="top"></td><td class="memItemRight" valign="bottom"><b><a href="qtsoaparrayiterator.html#QtSoapArrayIterator">QtSoapArrayIterator</a></b> ( QtSoapArray &amp; <i>array</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"></td><td class="memItemRight" valign="bottom"><b><a href="qtsoaparrayiterator.html#QtSoapArrayIterator-2">QtSoapArrayIterator</a></b> ( const QtSoapArrayIterator &amp; <i>copy</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"></td><td class="memItemRight" valign="bottom"><b><a href="qtsoaparrayiterator.html#dtor.QtSoapArrayIterator">~QtSoapArrayIterator</a></b> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><b><a href="qtsoaparrayiterator.html#atEnd">atEnd</a></b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">const QtSoapType * </td><td class="memItemRight" valign="bottom"><b><a href="qtsoaparrayiterator.html#current">current</a></b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">QtSoapType * </td><td class="memItemRight" valign="bottom"><b><a href="qtsoaparrayiterator.html#data">data</a></b> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qtsoaparrayiterator.html#pos">pos</a></b> ( int * <i>pos0</i>, int * <i>pos1</i> = 0, int * <i>pos2</i> = 0, int * <i>pos3</i> = 0, int * <i>pos4</i> = 0 ) const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><b><a href="qtsoaparrayiterator.html#pos-2">pos</a></b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><b><a href="qtsoaparrayiterator.html#operator-not-eq">operator!=</a></b> ( const QtSoapArrayIterator &amp; <i>j</i> ) const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qtsoaparrayiterator.html#operator-2b-2b">operator++</a></b> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">QtSoapArrayIterator &amp; </td><td class="memItemRight" valign="bottom"><b><a href="qtsoaparrayiterator.html#operator-eq">operator=</a></b> ( const QtSoapArrayIterator &amp; <i>copy</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><b><a href="qtsoaparrayiterator.html#operator-eq-eq">operator==</a></b> ( const QtSoapArrayIterator &amp; <i>j</i> ) const</td></tr>
</table>
<a name="details"></a>
<hr />
<h2>Detailed Description</h2>
<p>The QtSoapArrayIterator class provides an iterator for traversing the items in a <a href="qtsoaparray.html">QtSoapArray</a>.</p>
<p>The items are traversed in ascending order of index position, depth first.</p>
<pre><span class="comment"> // Construct a 2x2 array of Strings.</span>
 QtSoapArray array(&quot;Array of strings&quot;, String, 2, 2);
 array.insert(0, 0, new QtSoapSimpleType(Q4SoapQName(&quot;top left&quot;), &quot;top left&quot;);
 array.insert(0, 1, new QtSoapSimpleType(Q4SoapQName(&quot;top right&quot;), &quot;top right&quot;);
 array.insert(1, 0, new QtSoapSimpleType(Q4SoapQName(&quot;bottom left&quot;), &quot;bottom left&quot;);
 array.insert(1, 1, new QtSoapSimpleType(Q4SoapQName(&quot;bottom right&quot;), &quot;bottom right&quot;);

<span class="comment"> // Traverse all items.</span>
 QtSoapArrayIterator it(array);
 while (!it.current()) {

   <span class="comment">// Find the position of the current element.</span>
   int pos1, pos2;
   it.pos(&amp;pos1, &amp;pos2);

   qDebug() &lt;&lt; &quot;Position (&quot; &lt;&lt; pos1 &lt;&lt; &quot;, &quot; &lt;&lt; pos2 &lt;&lt; &quot;) is &quot;
            &lt;&lt; &quot;the &quot; &lt;&lt; it.current()-&gt;toString() &lt;&lt; &quot; coordinate of the grid.&quot; &lt;&lt; endl;

   ++it;
 }</pre>
<hr />
<h2>Member Function Documentation</h2>
<h3 class="fn"><a name="QtSoapArrayIterator"></a>QtSoapArrayIterator::QtSoapArrayIterator ( <a href="qtsoaparray.html">QtSoapArray</a> &amp; <i>array</i> )</h3>
<p>Constructs a <a href="qtsoaparrayiterator.html">QtSoapArrayIterator</a> on <i>array</i>, initializing the iterator to point to the first element.</p>
<h3 class="fn"><a name="QtSoapArrayIterator-2"></a>QtSoapArrayIterator::QtSoapArrayIterator ( const QtSoapArrayIterator &amp; <i>copy</i> )</h3>
<p>Constructs a <a href="qtsoaparrayiterator.html">QtSoapArrayIterator</a> that is a copy of <i>copy</i>.</p>
<h3 class="fn"><a name="dtor.QtSoapArrayIterator"></a>QtSoapArrayIterator::~QtSoapArrayIterator ()</h3>
<p>Destructs the <a href="qtsoaparrayiterator.html">QtSoapArrayIterator</a>.</p>
<h3 class="fn"><a name="atEnd"></a>bool QtSoapArrayIterator::atEnd () const</h3>
<p>Returns false if this iterator points to an item in the array, otherwise true.</p>
<h3 class="fn"><a name="current"></a>const <a href="qtsoaptype.html">QtSoapType</a> * QtSoapArrayIterator::current () const</h3>
<p>Returns a reference to the item that the iterator is currently pointing to.</p>
<h3 class="fn"><a name="data"></a><a href="qtsoaptype.html">QtSoapType</a> * QtSoapArrayIterator::data ()</h3>
<p>Returns a reference to the item that the iterator is currently pointing to.</p>
<h3 class="fn"><a name="pos"></a>void QtSoapArrayIterator::pos ( int * <i>pos0</i>, int * <i>pos1</i> = 0, int * <i>pos2</i> = 0, int * <i>pos3</i> = 0, int * <i>pos4</i> = 0 ) const</h3>
<p>Populates the arguments <i>pos0</i>, <i>pos1</i>, <i>pos2</i>, <i>pos3</i> and <i>pos4</i> with the coordinate of the current position of the iterator. For a one dimensional array, only <i>pos0</i> is populated. For a two dimensional array, <i>pos0</i> and <i>pos1</i> are populated, and so on.</p>
<p>Any of the arguments that are 0-pointers are ignored.</p>
<h3 class="fn"><a name="pos-2"></a>int QtSoapArrayIterator::pos () const</h3>
<p>This is an overloaded function.</p>
<p>Returns the ordinal position of the iterator. Works for arrays of any dimension, but is only useful for one dimensional arrays.</p>
<h3 class="fn"><a name="operator-not-eq"></a>bool QtSoapArrayIterator::operator!= ( const QtSoapArrayIterator &amp; <i>j</i> ) const</h3>
<p>Returns true if this Iterator's position is not equal to the position of <i>j</i>; otherwise returns false.</p>
<h3 class="fn"><a name="operator-2b-2b"></a>void QtSoapArrayIterator::operator++ ()</h3>
<p>Moves the iterator position to the next item in the array.</p>
<h3 class="fn"><a name="operator-eq"></a>QtSoapArrayIterator &amp; QtSoapArrayIterator::operator= ( const QtSoapArrayIterator &amp; <i>copy</i> )</h3>
<p>Assignment operator of <a href="qtsoaparrayiterator.html">QtSoapArrayIterator</a>. Makes this iterator a copy of <i>copy</i>.</p>
<h3 class="fn"><a name="operator-eq-eq"></a>bool QtSoapArrayIterator::operator== ( const QtSoapArrayIterator &amp; <i>j</i> ) const</h3>
<p>Returns true if this Iterator's position is equal to the position of <i>j</i>; otherwise returns false.</p>
<p /><address><hr /><div align="center">
<table width="100%" cellspacing="0" border="0"><tr class="address">
<td width="30%" align="left">Copyright &copy; 2010 Nokia Corporation and/or its subsidiary(-ies)</td>
<td width="40%" align="center"><a href="http://qt.nokia.com/doc/trademarks.html">Trademarks</a></td>
<td width="30%" align="right"><div align="right">Qt Solutions</div></td>
</tr></table></div></address></body>
</html>
